import React from 'react';
import { useParams } from 'react-router-dom';
import MarketPerformancePage from './market/MarketPerformancePage.js';
import EnergyCenter from './market/EnergyCenter.tsx';
import MarketStructurePage from './market/MarketStructurePage.tsx';
import PolicyNewsPage from './market/PolicyNewsPage.tsx';
import ProfitEffect from './market/ProfitEffect.tsx';
import HotspotTheme from './market/HotspotTheme.tsx';
import SentimentCycle from './market/SentimentCycle.js';
import AccountCurve from './market/AccountCurve.tsx';
import PositionManagement from './market/PositionManagement.tsx';
import WaveProfit from './market/WaveProfit.tsx';
import SpeculativeArbitrage from './market/SpeculativeArbitrage.tsx';
import MainLeaderStock from './market/MainLeaderStock.js';
import ValueLowAbsorption from './market/ValueLowAbsorption';
const MarketReview = () => {
  const { subpage } = useParams();
  console.log("subpage 2=", subpage);
  
  // 如果没有二级页面参数，使用默认值
  const currentSubpage = subpage || 'market-performance';
  
  const getPageTitle = () => {
    switch(currentSubpage) {
      case 'market-performance': return '大盘环境';
      case 'energy-center': return '能量中心';
      case 'market-structure': return '主线结构';
      case 'market-money-abnormal': return '资金异动';
      case 'policy-news': return '政策消息';
      case 'profit-effect': return '赚钱效应';
      case 'hotspot-theme': return '热点题材';
      case 'sentiment-cycle': return '情绪周期';
      case 'wave-profit': return '波段复利';
      case 'main-leader-stock': return '主线龙头';
      case 'speculative-arbitrage': return '投机套利';
      case 'value-low-absorption': return '价值低吸';
      case 'account-curve': return '账户曲线';
      case 'position-management': return '仓位管理';

      default: return '市场复盘';
    }
  }
  
  const getPageContent = () => {
    switch(currentSubpage) {
      case 'market-performance': 
        return <MarketPerformancePage />;
      case 'energy-center':
        return <EnergyCenter />;
      case 'market-structure':
        return <MarketStructurePage />;
      case 'policy-news':
        return <PolicyNewsPage />;
      case 'profit-effect':
        return <ProfitEffect />;
      case 'hotspot-theme':
        return <HotspotTheme />;
      case 'sentiment-cycle':
        return <SentimentCycle />;
      case 'wave-profit': return <WaveProfit />;
      case 'main-leader-stock': return <MainLeaderStock />;
      case 'speculative-arbitrage': return <SpeculativeArbitrage />;
      case 'value-low-absorption': return <ValueLowAbsorption />;
      case 'account-curve': return <AccountCurve />;
      case 'position-management': return <PositionManagement />;
      default:
        return <h2>请选择右侧内容板块</h2>
    }
  }

  return (
    <div className="page-container">
      <h2>每日复盘 - {getPageTitle()}</h2>
      {getPageContent()}
    </div>
  );
};

export default MarketReview;